//
//  Person.m
//  nsInvocation的使用
//
//  Created by ZhouFahong on 17/3/21.
//  Copyright © 2017年 ZhouFahong. All rights reserved.
//

#import "Person.h"
#import <objc/runtime.h>

@implementation Person

//-(instancetype)init{
//    self = [super init];
//    if (self) {
//        self.name = [[NSString alloc]init];
//        self.age = [[NSString alloc]init];
//        self.sex = [[NSString alloc]init];
//    }
//    return self;
//}

-(instancetype)init{
    if (self=[super init]) {
        
    }
    return self;
}

-(void)study{
    NSLog(@"我要学习了...");
    
}

-(void)eat{
    NSLog(@"我要吃饭了...");
}

-(void)sleep{
    NSLog(@"我要睡觉了...");
}

-(void)dealloc{
    NSLog(@"死了：%@",NSStringFromClass([Person class]));
}

-(id)copyWithZone:(NSZone *)zone{
    Person *person = [[Person allocWithZone:zone] init];
    person->_name = [_name copy];
    person->_age = [_age copy];
    person->_sex = [_sex copy];
    person->_name = [_name copyWithZone:zone];
    person->_age = [_age copyWithZone:zone];
    person->_sex = [_sex copyWithZone:zone];
    return person;
    
}

-(id)mutableCopyWithZone:(NSZone *)zone{
    Person *person = [[Person mutableCopy] init];
    person->_name = [_name copy];
    person->_age = [_age copy];
    person->_sex = [_sex copy];
    person->_name = [_name mutableCopyWithZone:zone];
    person->_age = [_age mutableCopyWithZone:zone];
    person->_sex = [_sex mutableCopyWithZone:zone];
    return person;
}

@end
